<?php
declare (strict_types=1);

namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;

class PushRabbitMQTest extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('push_rabbitmq_test')
            ->setDescription('the app\command\pushrabbitmqtest command');
    }

    protected function execute(Input $input, Output $output)
    {
        // 指令输出
        $startTime = microtime(true);
        $result = rabbitmqPush(json_encode(['name' => 'lisi', 'age' => 18], 320));
        $resumeTime = microtime(true) - $startTime;
        $output->writeln("[执行耗时]:{$resumeTime}");
    }
}
